Crystal Software Home Page

 Common tasks

Visit the Crystal Software Website
Technical Support Website

 

Replacing across a website...

  1. Drag and drop your website base/root folder to anywhere in TextPipe's window. It will get added to the Files to Process tab
  2. Add a Replace menu\Find exactly filter for each replacement required
  3. Click the [Go] button.

You can use a variety of pattern matching filters from the Replace menu. If you have more than one replacement, you can use a Replace menu\Search/Replace list, or import a list.

Grep through website logs

  1. Drag and drop your log files or log folder to anywhere in TextPipe's window. They will get added to the Files to Process tab
  2. If required, move the files in the file grid to change the order they are joined (or use a Special Menu\Sort filter)
  3. Add a Special Menu\Merge filter to join the files together
  4. To remove lines you never wish to see, add one or more Remove Menu\Matching lines filter
  5. To extract lines matching a pattern, add a Special Menu\Retain Matching Lines filter (note - any non-matching lines are discarded, so you can't really use 2 Retain Matching Lines filters in a row. Instead, use an or '|' operator in the pattern match)
  6. Set the Output filter to write all data to a new output file
  7. Click the [Go] button.

Fix CSV-delimited files

  1. Drag and drop your files or folders to anywhere in TextPipe's window. They will get added to the Files to Process tab
  2. To remove fields, add a Remove menu\CSV fields filter
  3. To copy fields, add a Special Menu\Copy CSV fields filter
  4. To move fields, add a Special Menu\Move CSV fields filter
  5. To replace inside specific fields, add a Restrict Menu\CSV fields filter, then add a Search/Replace sub filter.
  6. To convert specific fields to UPPERCASE, add a Convert Menu\Uppercase filter, then add a Search/Replace sub filter
  7. ..etc..
  8. Click the [Go] button.

Fix Tab-delimited files

  1. Drag and drop your files or folders to anywhere in TextPipe's window. They will get added to the Files to Process tab
  2. To remove fields, add a Remove menu\Tab fields filter
  3. To copy fields, add a Special Menu\Copy Tab fields filter
  4. To move fields, add a Special Menu\Move Tab fields filter
  5. To replace inside specific fields, add a Restrict Menu\Tab fields filter, then add a Search/Replace sub filter.
  6. To convert specific fields to UPPERCASE, add a Convert Menu\Uppercase filter, then add a Search/Replace sub filter
  7. ..etc..
  8. Click the [Go] button.

Convert from mainframe EBCDIC to ASCII

  1. Drag and drop your files or folders to anywhere in TextPipe's window. They will get added to the Files to Process tab
  2. Add a Convert Menu\EBCDIC -> ASCII filter
  3. Set the Input filter to Process Binary files
  4. Click the [Go] button.

Join, merge and sort files

  1. Drag and drop your files or folders to anywhere in TextPipe's window. They will get added to the Files to Process tab
  2. Add a Special Menu\Merge filter to join the files together
  3. Add a Special Menu\Sort filter
  4. Set the Output filter to write all data to a new output file
  5. Click the [Go] button.

Split files

  1. Drag and drop your files to anywhere in TextPipe's window. They will get added to the Files to Process tab
  2. Add a Special Menu\Split filter to split the files
  3. Set the Input filter to Process Binary files
  4. Click the [Go] button.

Extract data from a database

  1. Add a Special Menu\Database filter. Use the connection string to specify where the database is
  2. In the Trial Run Area, enter the text 'select * from tablename', where tablename is the name of your table
  3. Set the Input filter to Input from Trial Run Input
  4. Set the Output filter to write all data to a new output file
  5. Click the [Go] button.

You may wish to customize the output with additional search/replace filters.

Text and data mining

See the sample filter html\data mine html tables.fll for an example of converting a web page to a CSV file for import into Excel. This uses the Extract option of the Search and Replace filter.

Extract email addresses

  1. Drag and drop your files to anywhere in TextPipe's window. They will get added to the Files to Process tab
  2. Add an Email menu\Extract email addresses filter
  3. Add a Special menu\Merge filter
  4. Add a Special menu\Sort filter
  5. Add a Remove menu\Remove matching lines filter for any addresses you want excluded
  6. Set the Output filter to write all data to a new output file
  7. Click the [Go] button.

Other tasks

To add a filter, choose one from the menu. It will automatically be added to the filter list. Below are some common filtering operations and where to find the appropriate filter in the menus.

Common operations   Filter to use:
Find an HTML tag Use Replace Menu\Find pattern (perl style). Ensure that pattern matching is enabled using the drop down list, and that Minimal matching is specified in the advanced [...] dialog, then enter a search string like this:

<a[^>]*>

This will find all <a> tags. The [^>] means 'find any character except a '>', and the * means 'find 0 or more characters like this one.

Find text within an HTML tag e.g.

<a....height="130"....>

Use Replace Menu\Find inside an HTML tag. Ensure that pattern matching is enabled using the drop down list, and that Minimal matching is specified in the advanced [...] dialog, then enter a search string like this:

<a[^>]*>

This will find all <a...> tags. Now add a sub filter to perform the real search and replace on the text found inside the tags.

Find text between HTML tags e.g.

<a....>......</a>

Use Replace Menu\Find pattern. Ensure that Minimal matching is specified in the advanced [...] dialog, then enter a search string like this:

<a[^>]*>.*</a>

This will find all <a>...</a> tags. Now add a sub filter to perform the real search and replace on the text found between the tags.

Remove HTML Remove Menu\HTML and XML
Retain the head or tail of a file This is similar to the Unix command head and tail, use the Remove Menu/Remove start or end of file filter to remove lines or characters from the start or end of the file.
Swap date formats from dd-mm-yyyy to yyyy-mm-dd Using Replace Menu\Find pattern (perl style), add a search pattern of

  (\d+)-(\d+)-(\d+)

and a replacement of

  $3-$2-$1

Swap name formats from SURNAME, FIRST to FIRST SURNAME Using Replace Menu\Find pattern (perl style), add a search pattern of

  (\w+), (\w+)

and a replacement of

  $2 $1

Convert End of Line characters between Unix/DOS/Mac Convert Menu\End of Line characters
Search and replace Replace Menu\Find exactly
Pattern match and replace Replace Menu\Find pattern (perl style)
Add left margin (indent) Add Menu\Left margin
Unindent Use the Remove Menu\Columns filter to remove the first two characters on each line
Delete columns Remove Menu\Columns
Extract email addresses for mailing lists Email Menu\Extract emails
Remove blank lines Remove Menu\Blank lines
Sort Special Menu\Sort

After the filter is added to the filter list, you can click it to display options in the right hand side of the window. Each filter can be tailored in this manner.

 

 Contact Us   |  Support   |  Crystal Software Newsletter
 © 1999-2004 Crystal Software. All rights reserved.